package kr.couponplay.android.domain.deal;

import android.content.Context;
import kr.couponplay.android.ApiUrl;
import kr.couponplay.android.AppContext;
import kr.couponplay.android.domain.AppContextAware;
import kr.couponplay.android.support.HttpUtils;

public class ClickDao implements AppContextAware {
	private Context applicationContext;
	
	public void addClickDeal(int dealId) {
		try {
			String sid = AppContext.getSid(applicationContext);
			String url = ApiUrl.recentClickAddUrl + "?sid=" + sid + "&dealId=" + dealId;
			HttpUtils.executeToStr(url);
		} catch (Exception e) {
			throw new IllegalStateException(e.getMessage(), e);
		}
	}

	@Override
	public void setApplicationContext(Context applicationContext) {
		this.applicationContext = applicationContext;
	}
}
